﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Course.Controllers;
using Course.Models;

namespace Course.Views
{
    public partial class Register : Form
    {

        private RegisterController _controller;
       public RegisterController  Controller{
        get{
            return _controller;
    }
           set
           {
               _controller = value;
               this.textBox1.DataBindings.Add("Text", Controller.Model, "userId");
               this.textBox2.DataBindings.Add("Text", Controller.Model, "userName");
               this.textBox3.DataBindings.Add("Text", Controller.Model, "password");
               this.textBox4.DataBindings.Add("Text", Controller.Model, "grade");
               this.textBox5.DataBindings.Add("Text", Controller.Model, "myClass");
               this.textBox6.DataBindings.Add("Text", Controller.Model, "confirm");
               this.comboBox1.DataBindings.Add("Text", Controller.Model, "eRole");
           }
       }
        public Register()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click_1(object sender, EventArgs e)
        {

        }

        private void label7_Click(object sender, EventArgs e)
        {

        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            String result = Controller.register();
              MessageBox.Show(result);
        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {

        }

    }
}
